package com.lyandwc.lw_bbs.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.List;

@Data
@TableName("category")
public class Category {
    @JSONField()
    Integer id;
    @JSONField(ordinal = 1)
    String name;
    @JSONField(ordinal = 2)
    String description;
    @JSONField(ordinal = 3)
    String avatar;
    @JSONField(ordinal = 4)
    int topicCount;
    @JSONField(ordinal = 5)
    int commentCount;

    @JSONField(ordinal = 6)
    Integer fatherCategoryId;

    @JSONField(ordinal = 7)
    @TableField(exist = false)
    List<Category> sonCategories;
}
